public class Main {
    public static void main(String[] args) {
        Chessman a = new Chessman("黑棋",2,3);
        MementoCaretaker mementoCaretaker = new MementoCaretaker();
        System.out.println("当前下棋信息："+a.getLabel()+"坐标:"+"("+a.getX()+","+a.getY()+")");
        mementoCaretaker.setMemento(a.save());
        a.setX(3);
        a.setY(10);
        System.out.println("当前下棋信息："+a.getLabel()+"坐标:"+"("+a.getX()+","+a.getY()+")");
        a.restore(mementoCaretaker.getMemento());
        System.out.println("当前下棋信息："+a.getLabel()+"坐标:"+"("+a.getX()+","+a.getY()+")");
    }
}